package com.xcdh.ittools.type;

import com.xcdh.ittools.wrapper.DBColumnWrapper;

import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.List;


public class ITToolReturnType implements ParameterizedType{
    private final Type raw;
    private final Type[] args;

    public ITToolReturnType(Type raw, Type[] args) {
        this.raw = raw;
        this.args = args != null ? args : new Type[0];
    }

    public static ITToolReturnType create(Type raw, Type[] args){
        return new ITToolReturnType(raw,args) ;
    }

    public ITToolReturnType(Type raw, Class<?> cType) {
        this(raw , new Type[]{cType}) ;
    }
    public ITToolReturnType(Type raw) {
        this(raw , ( Type[])null) ;
    }

    public boolean isType(Class<?> t){
        return this.raw == t ;
    }

    @Override
    public Type[] getActualTypeArguments() {
        return args;
    }

    @Override
    public Type getRawType() {
        return raw;
    }

    @Override
    public Type getOwnerType() {
        return null;
    }




}
